home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Utility Spectacular / Developer / Mac F2C 1.0 / Mac F2C Libraries / libF77 Sources / s_stop.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-15  |  487 b   |  36 lines  |  [TEXT/KAHL]

  1. #include "stdio.h"
  2. #include "f2c.h"
  3.  
  4. #ifdef KR_headers
  5. extern void f_exit();
  6. VOID s_stop(s, n) char *s; ftnlen n;
  7. #else
  8. #undef abs
  9. #undef min
  10. #undef max
  11. #include "stdlib.h"
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. void f_exit(void);
  16.  
  17. int s_stop(char *s, ftnlen n)
  18. #endif
  19. {
  20. int i;
  21.  
  22. if(n > 0)
  23.     {
  24.     fprintf(stderr, "STOP ");
  25.     for(i = 0; i<n ; ++i)
  26.         putc(*s++, stderr);
  27.     fprintf(stderr, " statement executed\n");
  28.     }
  29. f_exit();
  30. exit(0);
  31. #ifdef __cplusplus
  32. return 0; /* NOT REACHED */
  33. }
  34. #endif
  35. }
  36.